package io.coderyeah.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.coderyeah.org.domain.BaseDomain;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * (Menu)表实体类
 *
 * @author makejava
 * @since 2022-09-20 09:09:54
 */
@SuppressWarnings("serial")
@Data
@TableName("t_menu")
public class Menu extends BaseDomain implements Serializable {

    // 菜单名称
    private String name;

    //所属模块
    private String component;
    // url地址
    private String url;

    // 菜单图标
    private String icon;
    // 菜单排序号
    @TableField("`index`")
    private Integer index;

    // 父级菜单id
    private Long parentId;

    // 菜单简介
    private String intro;

    // 菜单状态
    private Boolean state;

    // 父级菜单对象
    @TableField(exist = false)
    private Menu parent;

    //当前菜单下的所有子级菜单 注解过滤空集合
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Menu> children = new ArrayList<>();
}

